package dao

import (
	"dogapm"
	"gorm.io/gorm"
)

type OrderDao struct {
	gorm.Model
	OrderId string `json:"order_id" gorm:"order_id"`
	SkuId   int64  `json:"sku_id" gorm:"sku_id"`
	Num     int32  `json:"num" gorm:"num"`
	Price   int32  `json:"price" gorm:"price"`
	Uid     int64  `json:"uid" gorm:"uid"`
}

func (o *OrderDao) TableName() string {
	return "t_order"
}

func (o *OrderDao) Create(order OrderDao) error {
	db := dogapm.Infra.MySqlDB
	err := db.Create(&order).Error
	return err
}
